:header
call %working_dir%\header.cmd

REM 3-Packages.bat
REM This installs the packages into the image which include HTA, MDAC, Scripting, WDS and WMI.

:WAIK
REM Change DIR to Windows AIK
cd "%waik%\x86\Servicing"

:Main Menu
ECHO -------------------------------------
ECHO           Packages Menu
ECHO This is only needed for making WinPE
ECHO -------------------------------------
ECHO.
ECHO 1. Install Packages
ECHO 2. View Installed Packages
ECHO Q. Quit to Main Menu
ECHO.
ECHO.

REM ========== Choice Logic ============
choice /c:12q /n /m "%choice_text%"
if errorlevel 3 goto :end
if errorlevel 2 goto :showpackage
if errorlevel 1 goto :start

:start

ECHO Please be patient this may take awhile
ECHO.
dism /image:%wim_dest%\mount /Add-Package /PackagePath:"%systemdrive%\Program Files\Windows AIK\Tools\PETools\%arch-type%\WinPE_FPs\winpe-wmi.cab"
dism /image:%wim_dest%\mount /Add-Package /PackagePath:"%systemdrive%\Program Files\Windows AIK\Tools\PETools\%arch-type%\WinPE_FPs\winpe-hta.cab"
dism /image:%wim_dest%\mount /Add-Package /PackagePath:"%systemdrive%\Program Files\Windows AIK\Tools\PETools\%arch-type%\WinPE_FPs\winpe-mdac.cab"
dism /image:%wim_dest%\mount /Add-Package /PackagePath:"%systemdrive%\Program Files\Windows AIK\Tools\PETools\%arch-type%\WinPE_FPs\winpe-scripting.cab"
dism /image:%wim_dest%\mount /Add-Package /PackagePath:"%systemdrive%\Program Files\Windows AIK\Tools\PETools\%arch-type%\WinPE_FPs\winpe-wds-tools.cab"

:showpackage
call %working_dir%\header.cmd
echo Preparing List......

dism /image:%wim_dest%\mount\ /Get-Packages
ECHO.
ECHO Press a key to return to Package Menu
pause > nul
goto :header

:end
call %working_dir%\end.cmd